import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import i18n from '@/i18n/index'
import installElementPlus from './plugins/element'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { ElMessage } from 'element-plus'
//  初始化样式表
import '@/styles/index.scss'
//  导入所有的icon  因为在icon.index 下暴露的是箭头（Lambda 函数，所以这边可以直接定义一个函数名
import installIcons from '@/icon/index.js'
//  导入鉴权
import './permission'
//  增加uuid
import uuid from 'vue-uuid'

//  通过按需导入的createApp方法来构建vue实例
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
installElementPlus(app)
installIcons(app)
app.use(store).use(router).use(uuid).use(i18n).mount('#app')
